package org.dawning.bubble.auth;

import lombok.extern.log4j.Log4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * Created by miou on 2017/6/26 0026.
 */
@SpringBootApplication
@EnableAuthorizationServer
@RestController
@EnableResourceServer
@Log4j
public class AuthApplication {

    public static void main(String[] args) {
        SpringApplication.run(AuthApplication.class);
    }

    @RequestMapping("/user")
    public Principal user(Principal user) {
        return user;
    }

}
